<template>
  <div class="list">
    <!-- <h3 class="list-header">签约学生列表</h3> -->
    <div class="list-wrapper">
      <van-row class="theader">
        <van-col class="list-item list-item-header" span="3"> 姓名 </van-col>
        <van-col class="list-item list-item-header center" span="5">
          院校
        </van-col>
        <van-col class="list-item list-item-header center" span="4">
          层次
        </van-col>
        <van-col class="list-item list-item-header center" span="5">
          专业
        </van-col>
        <van-col class="list-item list-item-header center" span="4">
          成交价格
        </van-col>
        <van-col class="list-item list-item-header center" span="3">
          操作
        </van-col>
      </van-row>
      <div class="tbody" v-if="list && list.length > 0">
        <van-row
          @click="$router.push('/user/detail')"
          v-for="item in list"
          :key="item.id"
          class="list-item-wrapper"
        >
          <van-col class="list-item" span="3">{{ item.name }}</van-col>
          <van-col class="list-item center" span="5">{{ item.school }}</van-col>
          <van-col class="list-item center" span="4">{{ item.level }}</van-col>
          <van-col class="list-item center" span="5">
            {{ item.profession }}
          </van-col>
          <van-col class="list-item center" span="4">
            {{ item.price }}
          </van-col>
          <van-col class="list-item center link" span="3"> 资料 </van-col>
        </van-row>
      </div>
      <template v-if="list && list.length < 0">
        <div class="empty">暂无签约学生，加油哦~</div>
      </template>
    </div>
    <div class="nav-wrapper">
      <div class="chat-online" @click="$router.push('/form')">
        <img src="@/static/icon_online.png" alt="" />
        <span>签约学生</span>
      </div>
      <div class="sum" @click="$router.push('/user/sum')">
        <img src="@/static/sum.png" alt="" />
        <span>结算页</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: []
    };
  },
  mounted() {
    // 模拟数据
    for (let i = 0; i < 20; i++) {
      this.list.push({
        id: i,
        name: "小红" + i,
        school: "江西师范大学" + i,
        level: "本科" + i,
        profession: "农业智能化" + i,
        price: "3000" + i
      });
    }
  }
};
</script>

<style scoped lang="less">
.list {
  background-color: #fcfcfc;
  padding-top: 1px;
  padding-bottom: 0.7rem;
  font-size: 14px;
  // .list-header {
  //   text-align: center;
  //   padding: 0;
  //   margin: 0.45rem 0.25rem;
  // }
  .list-wrapper {
    font-size: 12px;
    // text-align: left;
    padding: 0 0.15rem;
    .tbody {
      height: 9.5rem;
      overflow-y: auto;
    }
    .empty {
      margin-top: 0.3rem;
      text-align: center;
      color: #999;
    }
    .theader,
    .list-item-wrapper {
      height: 0.8rem;
      padding: 0 0.1rem;
      background-color: #f1f1f1;
    }
    .list-item-wrapper:nth-child(2n + 1) {
      background-color: rgb(228, 237, 250);
    }
    .list-item {
      line-height: 0.8rem;
      color: #555;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }
    .list-item-header {
      color: #999;
      font-weight: bold;
    }
    .center {
      text-align: center;
    }
    .link {
      cursor: pointer;
      color: #3582fb;
    }
  }
  .nav-wrapper {
    box-sizing: border-box;
    background-color: #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    margin-top: 0.3rem;
    width: 100%;
    // border-top: 1px solid #eee;
    box-shadow: -0.01rem -0.02rem 0.2rem 0 #f1f1f1;
    // justify-content: space-around;
    .sum,
    .chat-online {
      height: 0.7rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 0.1rem;
      width: 50%;
      // background-color: #fff;
      // position: fixed;
      font-size: 0.16rem;
      color: #78a4ff;
      text-align: center;
      // vertical-align: baseline;
      img {
        margin-bottom: 0.1rem;
        display: block;
        width: 0.3rem;
        height: 0.3rem;
        margin-right: 0.15rem;
      }
      letter-spacing: 2px;
    }
    .chat-online {
      border-right: unset;
    }
  }
}
</style>
